package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.CategoryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface CategoryMapper {

    @AutoFill(OperationType.INSERT)
    void addCategory(Category category);

    List<Category> page(String name,Integer type);

    List<Category> list(Integer type);

    @AutoFill(OperationType.UPDATE)
    void updateStatus(Category category);

    @Delete("delete from category where id = #{id}")
    void deleteCategory(Long id);

    @AutoFill(OperationType.UPDATE)
    void updateCategory(Category category);
}
